package com.fddh.springboot.mapper;

import com.fddh.springboot.dto.NewUserDto;
import com.fddh.springboot.entity.User;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper //注释为Mapper
public interface UserMapper {

    //get all user
    List<User> getUserList();

    //get a user role by username
    int getUserRole(String username);

    //get a user by username
    User getUserByName(String username);

    //add new user
    int addUser(NewUserDto newuserDto);

    //delete user
    int deleteUser(String username);

    //update user
    void updateUser(NewUserDto newUserDto);

}
